package com.justnow.offer.argstransfer;

/**
 * @author justnow
 * Created on 2020-09-11
 * Description
 */
public class Demo03 {

    public static void main(String[] args) {
        String s = new String("aaa");
        System.out.println("原始字符串s的hashcode值：" + s.hashCode());
        change(s);
        System.out.println("方法调用后s的值"+s);
        System.out.println("方法调用后s的hashcode值"+s.hashCode());
    }

    public static void change(String s1) {
        System.out.println("方法中s1初始值：" + s1);
        System.out.println("方法中s1初始hashcode值" + s1.hashCode());
        String s2 = "bbb";
        System.out.println("方法中s1赋值后：" + s1);
        System.out.println("方法中s1赋值后hashcode值：" + s1.hashCode());
    }
}
